From 318f9de6a921dee457cd8ab113f0f5bd78c858bf Mon Sep 17 00:00:00 2001 From: justbur Date: Thu, 3 Dec 2015 11:15:19 -0500 Subject: [PATCH] Fix top-level note and satisfy compiler --- which-key.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/which-key.el b/which-key.el index f84461fad61..57214df430a 100644 --- a/which-key.el +++ b/which-key.el @@ -1149,7 +1149,7 @@ a replacement occurs return the new STRING." "KEYS is a string produced by `key-description'. A title is possibly returned using `which-key-prefix-title-alist'. An empty stiring is returned if no title exists." - (if keys + (if (not (string-equal keys "")) (let* ((alist which-key-prefix-title-alist) (res (assoc-string keys alist)) (mode-alist (assq major-mode alist)) @@ -1496,7 +1496,7 @@ area." delay nil (lambda () (let (message-log-max) (message "%s" text)))))) -(defun which-key--next-page-hint (prefix-keys n-pages) +(defun which-key--next-page-hint (prefix-keys) "Return string for next page hint." (let* ((paging-key (concat prefix-keys " " which-key-paging-key)) (paging-key-bound (eq 'which-key-C-h-dispatch @@ -1556,7 +1556,7 @@ enough space based on your settings and frame size." prefix-keys) prefix-w-face)) (status-left (format (concat "%-" (int-to-string first-col-width) "s") status-left)) - (nxt-pg-hint (which-key--next-page-hint prefix-keys n-pages)) + (nxt-pg-hint (which-key--next-page-hint prefix-keys)) new-end lines first) (cond ((and (< 1 n-pages) (eq which-key-show-prefix 'left)) @@ -1730,7 +1730,9 @@ prefix) if `which-key-use-C-h-commands' is non nil." "")) (k (string (read-key - (concat prefix-w-face dash-w-face + (concat (when (string-equal prefix-keys "") + (propertize " Top-level bindings" 'face 'which-key-note-face)) + prefix-w-face dash-w-face (propertize " [n]ext-page, [p]revious-page, [u]ndo-key, [h]elp, [a]bort" 'face 'which-key-note-face))))) (cmd (lookup-key which-key-C-h-map k)) -- 2.30.2